package com.lagou.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.lagou.entity.UserCourseOrder;
import com.lagou.service.OrderService;
import mapper.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public void saveOrder(String orderNo, String userId, String courseId, String activityCourseId, String sourceType) {

        orderDao.saveOrder(orderNo, userId, courseId, activityCourseId, sourceType);
    }

    @Override
    public Integer updateOrder(String orderNo, Integer status) {

        return orderDao.updateOrder(orderNo, status);
    }

    @Override
    public Integer deleteOrder(String orderNo) {

        return orderDao.deleteOrder(orderNo);
    }

    @Override
    public List<UserCourseOrder> getOrdersByUserId(String userId) {

        return orderDao.getOrdersByUserId(userId);
    }
}
